package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.QuickReplyMapper;
import com.ruoyi.system.domain.QuickReply;
import com.ruoyi.system.service.IQuickReplyService;

/**
 * 客服快捷回复Service业务层处理
 * 
 * @author ruoyi
 */
@Service
public class QuickReplyServiceImpl implements IQuickReplyService 
{
    @Autowired
    private QuickReplyMapper quickReplyMapper;

    /**
     * 查询客服快捷回复
     * 
     * @param id 客服快捷回复主键
     * @return 客服快捷回复
     */
    @Override
    public QuickReply selectQuickReplyById(Long id)
    {
        return quickReplyMapper.selectQuickReplyById(id);
    }

    /**
     * 查询客服快捷回复列表
     * 
     * @param quickReply 客服快捷回复
     * @return 客服快捷回复
     */
    @Override
    public List<QuickReply> selectQuickReplyList(QuickReply quickReply)
    {
        return quickReplyMapper.selectQuickReplyList(quickReply);
    }
    
    /**
     * 查询客服的快捷回复列表
     * 
     * @param serviceId 客服ID
     * @return 客服快捷回复集合
     */
    @Override
    public List<QuickReply> selectQuickReplyByServiceId(String serviceId)
    {
        return quickReplyMapper.selectQuickReplyByServiceId(serviceId);
    }
    
    /**
     * 查询客服指定分类的快捷回复列表
     * 
     * @param serviceId 客服ID
     * @param category 分类
     * @return 客服快捷回复集合
     */
    @Override
    public List<QuickReply> selectQuickReplyByCategory(String serviceId, String category)
    {
        return quickReplyMapper.selectQuickReplyByCategory(serviceId, category);
    }

    /**
     * 新增客服快捷回复
     * 
     * @param quickReply 客服快捷回复
     * @return 结果
     */
    @Override
    public int insertQuickReply(QuickReply quickReply)
    {
        quickReply.setCreateTime(new Date());
        return quickReplyMapper.insertQuickReply(quickReply);
    }

    /**
     * 修改客服快捷回复
     * 
     * @param quickReply 客服快捷回复
     * @return 结果
     */
    @Override
    public int updateQuickReply(QuickReply quickReply)
    {
        return quickReplyMapper.updateQuickReply(quickReply);
    }

    /**
     * 批量删除客服快捷回复
     * 
     * @param ids 需要删除的客服快捷回复主键
     * @return 结果
     */
    @Override
    public int deleteQuickReplyByIds(Long[] ids)
    {
        return quickReplyMapper.deleteQuickReplyByIds(ids);
    }

    /**
     * 删除客服快捷回复信息
     * 
     * @param id 客服快捷回复主键
     * @return 结果
     */
    @Override
    public int deleteQuickReplyById(Long id)
    {
        return quickReplyMapper.deleteQuickReplyById(id);
    }
} 